#ifndef CONSTANT_H
#define CONSTANT_H

#include <QString>
#include "operator.h"

class Constant : public Operator
{
public:
    enum Kind
	{
		Int,
		Float,
		String,
        VariableIdentifier,
        TagIdentifier,
        TagListIdentifier,
        True,
        False,
        Null,
        LambdaParameter
	};
	
    Constant( Kind kind, const YYLTYPE& loc );
    Constant( int number, const QString& metric, const YYLTYPE& loc );
    Constant( double number, const QString& metric, const YYLTYPE& loc );
    Constant( const QString& str, Kind kind, const YYLTYPE& loc );

	int intValue() const;
	int floatValue() const;
	QString metric() const;
	QString stringValue() const;
    Kind kind() const { return m_kind; }
	
    Node* resolvedNode() const { return m_resolvedNode; }
    virtual void resolveAll();
    virtual Type type();

private:
	int m_int;
	double m_float;
	QString m_string;
    Kind m_kind;
    Node* m_resolvedNode;
};

#endif
